#!/usr/bin/make -f
#
# This makefile creates .zip archives containing the headers and possibly
# win32 import libraries and precompiled dos/win32 binaries. There's one
# archive (for all hosts) per set of headers.
#
# dlltool is required to build the win32 import libraries, other precompiled
# binaries need to be present (supplied manually) to continue building the
# archives.
#
# Installing/uninstalling headers from this source tree:
#    make [un]install [prefix=foo]
#
# For fun, here's an example of how to make .tar.xz's:
#    make ARCHIVER='tar -cJf' ARCHIVE_SUFFIX=.tar.xz
#

#
# List of packages
# Packages don't need to be one-pack-per-lib, rather they should be useful
# sets of headers. If headers belong together, just throw them together,
# that's the easiest solution. Of course official .debs or .rpms might ask for
# more diversity, but we'll deal with that problem when we get to it.
#

PACKS += allegro aspell
PACKS += bass big_int bzip2
PACKS += caca cairo cgui chipmunk crt cryptlib cunit curl curses
PACKS += dislin disphelper dos
PACKS += expat
PACKS += fastcgi ffi flite fmod freeimage freetype
PACKS += gd gdbm gdsl gettext giflib gmp grx gsl gtk
PACKS += devil
PACKS += intl iup
PACKS += japi jit jni jpeglib jpgalleg
PACKS += lua lzma lzo
PACKS += mediainfo mpg123 mxml mysql
PACKS += newton
PACKS += ode ogg openal opengl
PACKS += pcre pdflib png portaudio postgeqsql
PACKS += quicklz
PACKS += tre
PACKS += sdl sndfile spidermonkey sqlite
PACKS += uuid
PACKS += vlc vorbis
PACKS += win32api wxc
PACKS += x11 xml2 xslt
PACKS += zip zlib zeromq

#
# Package versions
# (should be <upstreamversion>-<ourrevision>, or a snapshot date of our
# current headers, or something, to allow updating the number on every
# update/bugfix reupload, as far as possible)
#
version_allegro    += 4.1-1
version_aspell     += 0.50-1
version_bass       += 2.0-1
version_big_int    += unknown-2005
version_bzip2      += 1.0.6-1
version_caca       += 0.99.beta17-1
version_cairo      += 1.2.6-1
version_cgui       += 2.0.1-2
version_chipmunk   += 4.1.0-1
version_crt        += 2011-1
version_cryptlib   += unknown-2005
version_cunit      += 2.1-0-1
version_curl       += 7.21.6-1
version_curses     += unknown-2005
version_dislin     += unknown-2005
version_disphelper += unknown-2005
version_dos        += 2011-1
version_expat      += 1.95.8-1
version_fastcgi    += 2011-10
version_ffi        += 3.0.10-1
version_flite      += 1.4-1
version_fmod       += 3.74-1
version_freeimage  += 3.15.1-1
version_freetype   += 2.1.9-1
version_gd         += unknown-2005
version_gdbm       += unknown-2010
version_gdsl       += unknown-2005
version_gettext    += 0.17-1
version_giflib     += 4.1-1
version_openal     += 2011-1
version_opengl     += 2011-2
version_gmp        += 4.1.4-1
version_grx        += 2.4.6-1
version_gsl        += 1.6-1
version_gtk        += 2-unknown
version_devil      += 1.6.7-1
version_intl       += unknown-2010
version_iup        += 3.5-1
version_japi       += unknown-2005
version_jit        += 0.1.2-1
version_jni        += unknown-2006
version_jpeglib    += 6.2-1
version_jpgalleg   += 2.5-1
version_lua        += 5.1.1-1
version_lzma       += 5.0.2-1
version_lzo        += 2.02-1
version_mediainfo  += unknown-2011
version_mpg123     += unknown-2010
version_mxml       += unknown-2005
version_mysql      += 4.0.17-1
version_newton     += unknown-2005
version_ode        += 0.9-1
version_ogg        += unknown-2007
version_pcre       += 7.6-1
version_pdflib     += 4.0.2-1
version_png        += 1.2.16-1
version_portaudio  += unknown-2010
version_postgeqsql += unknown-2006
version_quicklz    += 1.50-1
version_tre        += unknown-2006
version_sdl        += 1.2.9-1
version_sndfile    += 1.0.x-1
version_spidermonkey += unknown-2006
version_sqlite     += 3.7.8-1
version_uuid       += unknown-2010
version_vlc        += 1.1.x-1
version_vorbis     += unknown-2007
version_win32api   += 2011-1
version_wxc        += 0.9.0.2-2
version_x11        += 2010
version_xml2       += 2.6.17-1
version_xslt       += 1.1.13-1
version_zip        += 0.10-1
version_zlib       += 1.2.2-1
version_zeromq     += 2.1.10-1

#
# Which files to put into each package
#
# Note: Parent directories should be listed behind their sub-directories,
# so 'make uninstall' can remove the directories properly.
#

pack_openal     += inc/AL/
pack_allegro    += inc/allegro.bi
pack_allegro    += inc/allegro/inline/
pack_allegro    += inc/allegro/internal/
pack_allegro    += inc/allegro/platform/
pack_allegro    += inc/allegro/
pack_aspell     += inc/aspell.bi
pack_bass       += inc/bass.bi
pack_bass       += inc/bassmod.bi
pack_big_int    += inc/big_int/
pack_bzip2      += inc/bzlib.bi
pack_caca       += inc/caca.bi
pack_cairo      += inc/cairo/
pack_cgui       += inc/cgui.bi
pack_chipmunk   += inc/chipmunk/constraints/
pack_chipmunk   += inc/chipmunk/
pack_crt        += inc/crt.bi
pack_crt        += inc/crt/arpa/
pack_crt        += inc/crt/bits/
pack_crt        += inc/crt/dos/
pack_crt        += inc/crt/sys/dos/
pack_crt        += inc/crt/linux/
pack_crt        += inc/crt/netinet/linux/
pack_crt        += inc/crt/sys/linux/
pack_crt        += inc/crt/win32/
pack_crt        += inc/crt/sys/win32/
pack_crt        += inc/crt/netinet/
pack_crt        += inc/crt/sys/
pack_crt        += inc/crt/
pack_cryptlib   += inc/cryptlib.bi
pack_cunit      += inc/CUnit/
pack_curl       += inc/curl.bi
pack_curses     += inc/curses.bi
pack_curses     += inc/curses/
pack_dislin     += inc/dislin.bi
pack_disphelper += inc/disphelper/
pack_dos        += inc/dos/inlines/
pack_dos        += inc/dos/sys/
pack_dos        += inc/dos/
pack_expat      += inc/expat.bi
pack_fastcgi    += inc/fastcgi/
pack_ffi        += inc/ffi.bi
pack_ffi        += inc/ffi/win32/
pack_flite      += inc/flite/
pack_fmod       += inc/fmod.bi
pack_freeimage  += inc/FreeImage.bi
pack_freetype   += inc/freetype2/config/
pack_freetype   += inc/freetype2/
pack_gd         += inc/gd/
pack_gdbm       += inc/gdbm.bi
pack_gdsl       += inc/gdsl/
pack_gettext    += inc/gettext-po.bi
pack_giflib     += inc/gif_lib.bi
pack_opengl     += inc/GL/
pack_gmp        += inc/gmp.bi
pack_grx        += inc/grx/
pack_gsl        += inc/gsl/
pack_gtk        += inc/gtk/atk/
pack_gtk        += inc/gtk/gdk/
pack_gtk        += inc/gtk/gdkgl/
pack_gtk        += inc/gtk/gdk-pixbuf/
pack_gtk        += inc/gtk/glib/
pack_gtk        += inc/gtk/gobject/
pack_gtk        += inc/gtk/gtk/
pack_gtk        += inc/gtk/gtkgl/
pack_gtk        += inc/gtk/libart/
pack_gtk        += inc/gtk/libglade/
pack_gtk        += inc/gtk/pango/
pack_gtk        += inc/gtk/
pack_devil      += inc/IL/
pack_iup        += inc/IUP/
pack_iup        += inc/IUP3/
pack_japi       += inc/japi.bi
pack_jit        += inc/jit.bi
pack_jit        += inc/jit/
pack_jni        += inc/jni.bi
pack_jpeglib    += inc/jpeglib.bi
pack_jpgalleg   += inc/jpgalleg.bi
pack_intl       += inc/libintl.bi
pack_xml2       += inc/libxml/
pack_xslt       += inc/libxslt/
pack_lua        += inc/Lua/
pack_lzma       += inc/lzma.bi
pack_lzo        += inc/lzo/
pack_mediainfo  += inc/MediaInfo.bi
pack_mpg123     += inc/mpg123.bi
pack_mxml       += inc/mxml.bi
pack_mysql      += inc/mysql/
pack_newton     += inc/Newton.bi
pack_ode        += inc/ode/
pack_ogg        += inc/ogg/
pack_pcre       += inc/pcre/
pack_pdflib     += inc/pdflib.bi
pack_png        += inc/png.bi
pack_portaudio  += inc/portaudio.bi
pack_postgeqsql += inc/postgresql/
pack_quicklz    += inc/quicklz.bi
pack_tre        += inc/regex.bi
pack_sdl        += inc/SDL/
pack_sndfile    += inc/sndfile.bi
pack_spidermonkey += inc/spidermonkey/
pack_sqlite     += inc/sqlite2.bi
pack_sqlite     += inc/sqlite3.bi
pack_uuid       += inc/uuid.bi
pack_vlc        += inc/vlc/
pack_vorbis     += inc/vorbis/
pack_win32api   += inc/windows.bi
pack_win32api   += inc/win/ddk/
pack_win32api   += inc/win/rc/
pack_win32api   += inc/win/
pack_wxc        += inc/wx-c/
pack_x11        += inc/X11/extensions/
pack_x11        += inc/X11/ICE/
pack_x11        += inc/X11/SM/
pack_x11        += inc/X11/Xcursor/
pack_x11        += inc/X11/Xft/
pack_x11        += inc/X11/Xmu/
pack_x11        += inc/X11/Xtrans/
pack_x11        += inc/X11/
pack_zip        += inc/zip.bi
pack_zlib       += inc/zlib.bi
pack_zeromq     += inc/zmq/

#
# Prebuilt dos/win32 DLLs and static/import libraries
#

pack_cgui       += bin/cgui20.dll
pack_opengl     += bin/freeglut.dll
pack_opengl     += bin/glfw.dll

pack_cgui       += lib/dos/libcgui.a

pack_win32api   += lib/libaclui.dll.a
pack_win32api   += lib/libadvapi32.dll.a
pack_openal     += lib/libalut.dll.a
pack_allegro    += lib/liballeg.dll.a
pack_win32api   += lib/libapcups.dll.a
pack_win32api   += lib/libavicap32.dll.a
pack_win32api   += lib/libavifil32.dll.a
pack_gtk        += lib/libart_lgpl_2.dll.a
pack_aspell     += lib/libaspell-15.dll.a
pack_gtk        += lib/libatk-1.0.dll.a
pack_bass       += lib/libbass.dll.a
pack_bass       += lib/libbassmod.dll.a
pack_win32api   += lib/libbthprops.dll.a
pack_cairo      += lib/libcairo.dll.a
pack_win32api   += lib/libcap.dll.a
pack_cgui       += lib/libcgui.dll.a
pack_win32api   += lib/libcfgmgr32.dll.a
pack_win32api   += lib/libcomctl32.dll.a
pack_win32api   += lib/libcomdlg32.dll.a
pack_win32api   += lib/libcrypt32.dll.a
pack_win32api   += lib/libctl3d32.dll.a
pack_cryptlib   += lib/libcrypt.dll.a
pack_curl       += lib/libcurl.dll.a
pack_win32api   += lib/libd3d8.dll.a
pack_win32api   += lib/libd3d9.dll.a
pack_win32api   += lib/libd3dim.dll.a
pack_win32api   += lib/libd3drm.dll.a
pack_win32api   += lib/libd3dx8d.dll.a
pack_win32api   += lib/libd3dx9d.dll.a
pack_win32api   += lib/libd3dxof.dll.a
pack_devil      += lib/libDevIL.dll.a
pack_win32api   += lib/libddraw.dll.a
pack_win32api   += lib/libdhcpcsvc.dll.a
pack_win32api   += lib/libdinput.dll.a
pack_win32api   += lib/libdinput8.dll.a
pack_win32api   += lib/libdlcapi.dll.a
pack_win32api   += lib/libdmoguids.dll.a
pack_win32api   += lib/libdnsapi.dll.a
pack_win32api   += lib/libdplayx.dll.a
pack_win32api   += lib/libdpnaddr.dll.a
pack_win32api   += lib/libdpnet.dll.a
pack_win32api   += lib/libdpnlobby.dll.a
pack_win32api   += lib/libdpvoice.dll.a
pack_win32api   += lib/libdsetup.dll.a
pack_win32api   += lib/libdsound.dll.a
pack_win32api   += lib/libdxapi.dll.a
pack_win32api   += lib/libdxerr8.dll.a
pack_win32api   += lib/libdxerr9.dll.a
pack_win32api   += lib/libdxguid.dll.a
pack_expat      += lib/libexpat.dll.a
pack_expat      += lib/libexpatw.dll.a
pack_win32api   += lib/libfaultrep.dll.a
pack_fastcgi    += lib/libfcgi.dll.a
pack_fmod       += lib/libfmod.dll.a
pack_opengl     += lib/libfreeglut.a
pack_opengl     += lib/libfreeglut_static.a
pack_freeimage  += lib/libFreeImage.dll.a
pack_freetype   += lib/libfreetype.dll.a
pack_win32api   += lib/libgdi32.dll.a
pack_win32api   += lib/libgdiplus.dll.a
pack_gtk        += lib/libgdk_pixbuf-2.0.dll.a
pack_gtk        += lib/libgdk-win32-2.0.dll.a
pack_gtk        += lib/libgdkglext-win32-1.0.dll.a
pack_gtk        += lib/libglade-2.0.dll.a
pack_opengl     += lib/libglaux.dll.a     # Deprecated OpenGL Auxiliary Library
pack_gtk        += lib/libglib-2.0.dll.a
pack_opengl     += lib/libglfw.a
pack_opengl     += lib/libglfwdll.a
pack_win32api   += lib/libglu32.dll.a
pack_opengl     += lib/libglut.dll.a      # GLUT for SGI OpenGL
pack_opengl     += lib/libglut32.dll.a    # GLUT for Microsoft OpenGL
pack_gtk        += lib/libgmodule-2.0.dll.a
pack_gmp        += lib/libgmp.dll.a
pack_gtk        += lib/libgobject-2.0.dll.a
pack_gsl        += lib/libgsl.dll.a
pack_gtk        += lib/libgtk-win32-2.0.dll.a
pack_gtk        += lib/libgtkglext-win32-1.0.dll.a
pack_win32api   += lib/libhal.dll.a
pack_win32api   += lib/libhid.dll.a
pack_win32api   += lib/libhidparse.dll.a
pack_win32api   += lib/libicmui.dll.a
pack_win32api   += lib/libigmpagnt.dll.a
pack_devil      += lib/libILU.dll.a
pack_devil      += lib/libILUT.dll.a
pack_win32api   += lib/libimagehlp.dll.a
pack_win32api   += lib/libimm32.dll.a
pack_win32api   += lib/libiphlpapi.dll.a
pack_iup        += lib/libiup.dll.a
pack_iup        += lib/libiupcontrols.dll.a
pack_jpeglib    += lib/libjpeg.dll.a
pack_jni        += lib/libjvm.dll.a
pack_win32api   += lib/libkernel32.dll.a
pack_win32api   += lib/libksproxy.dll.a
pack_win32api   += lib/libksuser.dll.a
pack_win32api   += lib/liblargeint.dll.a
pack_win32api   += lib/liblz32.dll.a
pack_win32api   += lib/libmapi32.dll.a
pack_win32api   += lib/libmcd.dll.a
pack_mediainfo  += lib/libMediaInfo.dll.a
pack_win32api   += lib/libmfcuia32.dll.a
pack_win32api   += lib/libmgmtapi.dll.a
pack_win32api   += lib/libmpr.dll.a
pack_win32api   += lib/libmprapi.dll.a
pack_win32api   += lib/libmqrt.dll.a
pack_win32api   += lib/libmsacm32.dll.a
pack_win32api   += lib/libmscms.dll.a
pack_win32api   += lib/libmsdmo.dll.a
pack_win32api   += lib/libmsimg32.dll.a
pack_win32api   += lib/libmsvcp60.dll.a
pack_win32api   += lib/libmsvcrt.dll.a
pack_win32api   += lib/libmsvfw32.dll.a
pack_win32api   += lib/libmswsock.dll.a
pack_mysql      += lib/libmySQL.dll.a
pack_win32api   += lib/libnddeapi.dll.a
pack_win32api   += lib/libndis.dll.a
pack_win32api   += lib/libnetapi32.dll.a
pack_win32api   += lib/libnewdev.dll.a
pack_newton     += lib/libNewton.dll.a
pack_win32api   += lib/libntdll.dll.a
pack_win32api   += lib/libntoskrnl.dll.a
pack_win32api   += lib/libodbc32.dll.a
pack_win32api   += lib/libodbccp32.dll.a
pack_ode        += lib/libode.dll.a
pack_win32api   += lib/libole32.dll.a
pack_win32api   += lib/liboleacc.dll.a
pack_win32api   += lib/liboleaut32.dll.a
pack_win32api   += lib/libolecli32.dll.a
pack_win32api   += lib/liboledlg.dll.a
pack_win32api   += lib/libolepro32.dll.a
pack_win32api   += lib/libolesvr32.dll.a
pack_openal     += lib/libOpenAL32.dll.a
pack_opengl     += lib/libopengl32.dll.a
pack_gtk        += lib/libpango-1.0.dll.a
pack_gtk        += lib/libpangowin32-1.0.dll.a
pack_pcre       += lib/libpcre.dll.a
pack_pcre       += lib/libpcreposix.dll.a
pack_pdflib     += lib/libpdf.dll.a
pack_win32api   += lib/libpenwin32.dll.a
pack_win32api   += lib/libpkpd32.dll.a
pack_png        += lib/libpng.dll.a
pack_win32api   += lib/libpowrprof.dll.a
pack_postgeqsql += lib/libpq.dll.a
pack_win32api   += lib/libpsapi.dll.a
pack_win32api   += lib/libquartz.dll.a
pack_win32api   += lib/librapi.dll.a
pack_win32api   += lib/librasapi32.dll.a
pack_win32api   += lib/librasdlg.dll.a
pack_win32api   += lib/librpcdce4.dll.a
pack_win32api   += lib/librpcns4.dll.a
pack_win32api   += lib/librpcrt4.dll.a
pack_win32api   += lib/librtm.dll.a
pack_win32api   += lib/librtutils.dll.a
pack_win32api   += lib/libscrnsave.dll.a
pack_win32api   += lib/libscrnsavw.dll.a
pack_win32api   += lib/libscsiport.dll.a
pack_sdl        += lib/libSDL.dll.a
pack_sdl        += lib/libSDL_gfx.dll.a
pack_sdl        += lib/libSDL_image.dll.a
pack_sdl        += lib/libSDL_mixer.dll.a
pack_sdl        += lib/libSDL_net.dll.a
pack_sdl        += lib/libSDL_ttf.dll.a
pack_win32api   += lib/libsecur32.dll.a
pack_win32api   += lib/libsetupapi.dll.a
pack_win32api   += lib/libshell32.dll.a
pack_win32api   += lib/libshfolder.dll.a
pack_win32api   += lib/libshlwapi.dll.a
pack_win32api   += lib/libsnmpapi.dll.a
pack_sqlite     += lib/libsqlite.dll.a
pack_sqlite     += lib/libsqlite3.dll.a
pack_win32api   += lib/libstrmiids.dll.a
pack_win32api   += lib/libsvrapi.dll.a
pack_win32api   += lib/libtapi32.dll.a
pack_win32api   += lib/libtdi.dll.a
pack_win32api   += lib/libthunk32.dll.a
pack_win32api   += lib/liburl.dll.a
pack_win32api   += lib/libusbcamd.dll.a
pack_win32api   += lib/libusbcamd2.dll.a
pack_win32api   += lib/libuser32.dll.a
pack_win32api   += lib/libuserenv.dll.a
pack_win32api   += lib/libusp10.dll.a
pack_win32api   += lib/libuuid.dll.a
pack_win32api   += lib/libuxtheme.dll.a
pack_win32api   += lib/libvdmdbg.dll.a
pack_win32api   += lib/libversion.dll.a
pack_win32api   += lib/libvfw32.dll.a
pack_win32api   += lib/libvideoprt.dll.a
pack_win32api   += lib/libwin32k.dll.a
pack_win32api   += lib/libwin32spl.dll.a
pack_win32api   += lib/libwininet.dll.a
pack_win32api   += lib/libwinmm.dll.a
pack_win32api   += lib/libwinspool.dll.a
pack_win32api   += lib/libwinstrm.dll.a
pack_win32api   += lib/libwldap32.dll.a
pack_win32api   += lib/libwow32.dll.a
pack_win32api   += lib/libws2_32.dll.a
pack_win32api   += lib/libwsnmp32.dll.a
pack_win32api   += lib/libwsock32.dll.a
pack_win32api   += lib/libwst.dll.a
pack_win32api   += lib/libwtsapi32.dll.a
pack_xml2       += lib/libxml2.dll.a
pack_xslt       += lib/libxslt.dll.a
pack_wxc        += lib/libwx-c-0-9-0-2.dll.a
pack_zlib       += lib/libz.dll.a

#
# Archive creation
#

ifndef V
  QUIET_CP      = @echo "CP $@";
  QUIET_DLLTOOL = @echo "DLLTOOL $@";
  QUIET_PACK    = @echo "PACK $@";
endif

ARCHIVER := zip -q -9
ARCHIVE_PREFIX := fb-
ARCHIVE_SUFFIX := .zip
DLLTOOL := dlltool
prefix := /usr/local

.PHONY: all
all:

# Archive build rule with the archive-to-files association, using $(eval)
# to save us from typing one such rule per archive.
# This goes through the package names and looks at the corresponding pack_*
# variable. It extracts the list of specified directories and does a $(wildcard)
# on each of them. Directly specified headers and libraries are preserved as-is.
define declare-archive-dependency

pack_$(1)_dirs := $$(filter inc/%/,$$(pack_$(1)))
pack_$(1)_files := $$(filter %.bi lib/% bin/%,$$(pack_$(1)))
pack_$(1)_files += $$(foreach i,$$(pack_$(1)_dirs),$$(wildcard $$(i)*.bi))

ALLINCLUDEDIRS += $$(pack_$(1)_dirs)
ALLINCLUDEFILES += $$(filter %.bi,$$(pack_$(1)_files))

# <prefix><name>-<version><suffix>
$$(ARCHIVE_PREFIX)$(1)-$$(version_$(1))$$(ARCHIVE_SUFFIX): $$(pack_$(1)_files)
	$$(QUIET_PACK)$$(ARCHIVER) $$@ $$^

all: $$(ARCHIVE_PREFIX)$(1)-$$(version_$(1))$$(ARCHIVE_SUFFIX)

endef

$(eval $(foreach i,$(PACKS),$(call declare-archive-dependency,$(i))))

# Some libraries need extra dlltool flags, otherwise the symbol names in the
# import library may be different from those in the DLL, or different from
# those expected by the headers/calling conventions.
lib/libFreeImage.dll.a: DTFLAGS := --add-stdcall-underscore
lib/libbass.dll.a:      DTFLAGS := --kill-at
lib/libbassmod.dll.a:   DTFLAGS := --kill-at
lib/libcrypt.dll.a:     DTFLAGS := --kill-at
lib/libglut32.dll.a:    DTFLAGS := --kill-at
lib/libglut.dll.a:      DTFLAGS := --kill-at
lib/libfmod.dll.a:      DTFLAGS := --add-stdcall-underscore
lib/libjvm.dll.a:       DTFLAGS := --kill-at
lib/libmySQL.dll.a:     DTFLAGS := --kill-at
lib/libwx-c-0-9-0-2.dll.a: DTFLAGS := --add-stdcall-underscore

# Create import libraries if we have the .def. (For others, 'make' will
# complain if they aren't there, and you need to supply them manually.)
IMPLIBS_WITH_DEFS := $(patsubst lib/%.def,lib/lib%.dll.a,$(wildcard lib/*.def))
$(IMPLIBS_WITH_DEFS): lib/lib%.dll.a: lib/%.def
	$(QUIET_DLLTOOL)$(DLLTOOL) -d $< -l $@ $(DTFLAGS)

# Install includes while creating the needed include sub-directories
.PHONY: install
install: $(prefix)/include/freebasic
	cd inc/ && cp --parents --remove-destination $(patsubst inc/%,%,$(ALLINCLUDEFILES)) $(prefix)/include/freebasic

# Remove includes from $(prefix), then also the include sub-directories
.PHONY: uninstall
uninstall:
	-rm -f $(patsubst %,$(prefix)/%,$(patsubst inc/%,include/freebasic/%,$(ALLINCLUDEFILES)))
	-rmdir $(patsubst inc/%,$(prefix)/include/freebasic/%,$(ALLINCLUDEDIRS))

.PHONY: clean
clean:
	-rm -f *.zip $(IMPLIBS_WITH_DEFS)

.SUFFIXES:
